package com.maimeng.Services;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Service;
@ConfigurationProperties("cache")
@Service
public class CacheService {

    @Value(value = "${test}")
    private String test;

    private String type;

    private int port;

    private String [] service;

    public String[] getService() {
        return service;
    }

    public void setService(String[] service) {
        this.service = service;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }



    public String getCache(String key)
    {
            for (String s:service) {
            System.out.println(s);
        }
        return key+this.type+String.valueOf(this.getPort())+"____"+this.test;
    }
}
